<!--
 * @Author: thl
 * @Date: 2023-07-03 13:28:53
 * @FilePath: \supply-chain-management\src\components\TheTable\components\Column.vue
 * @Description: 
-->
<template>
  <el-table-column
    v-if="!column.columnType || column.columnType === 'default'"
    resizable
    show-overflow-tooltip
    :type="column.columnType || 'default'"
    :label="column.label"
    :prop="column.prop"
    :align="column.align || 'left'"
    :min-width="autoWidth ? '' : column.width || 100"
    :fixed="column.fixed"
    :render-header="column.renderHeader"
    header-align="left"

  >
    <template slot-scope="scope">
      <el-input
        v-if="editableRowIndex === scope.$index && column.editable"
        :type="column.inputType || 'text'"
        :min="0"
        v-model="scope.row[column.prop]"
        @keyup.enter.native="$emit('cellClick')"
      ></el-input>
      <div v-else @click="$emit('cellClick')">
        <CustomCell
          :row="scope.row"
          :column="column"
          :index="scope.$index"
          :render="column.render"
        />
      </div>
    </template>
  </el-table-column>
  <el-table-column
    v-else
    resizable
    show-overflow-tooltip
    :type="column.columnType"
    :label="column.label"
    :prop="column.prop"
    :selectable="column.selectable"
    :min-width="autoWidth ? '' : column.width || 200"
    :fixed="column.fixed"
  ></el-table-column>
</template>
     :align="column.align || 'center'"
<script>
import CustomCell from "./CustomCell.vue";
export default {
  components: { CustomCell },
  props: {
    autoWidth: Boolean,
    column: Object,
    editableRowIndex: Number,
  },
  data() {
    return {};
  },
  watch() {},
  mounted() {},
  methods: {},
};
</script>
<style scoped lang='scss'>
</style>